home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.mactech.com 2010
/
ftp.mactech.com.tar
/
ftp.mactech.com
/
thinkref
/
archive
/
THINKPascalUH2.1.sea
/
THINKPas Univ Hdr 2.1
/
Interfaces
/
StandardFile.p
< prev
next >
Wrap
Text File
|
1995-09-14
|
9KB
|
278 lines
{ Converted with MPW2TPas Tuesday, September 12, 1995 10:31:24 PM }
{}
{ File: StandardFile.p}
{ }
{ Contains: Standard File package Interfaces.}
{ }
{ Version: Technology: System 7.5}
{ Package: Universal Interfaces 2.1 in “MPW Latest” on ETO #18}
{ }
{ Copyright: © 1984-1995 by Apple Computer, Inc.}
{ All rights reserved.}
{ }
{ Bugs?: If you find a problem with this file, use the Apple Bug Reporter}
{ stack. Include the file and version information (from above)}
{ in the problem description and send to:}
{ Internet: apple.bugs@applelink.apple.com}
{ AppleLink: APPLE.BUGS}
{ }
{}
unit StandardFile;
interface
{$IFC UNDEFINED __STANDARDFILE__}
{$SETC __STANDARDFILE__ := 1}
uses
ConditionalMacros, Types, Quickdraw, Dialogs, Files;
{ $PUSH}
{ $ALIGN MAC68K}
{ $LibExport+}
const
{ resource IDs and item offsets of pre-7.0 dialogs }
putDlgID = -3999;
putSave = 1;
putCancel = 2;
putEject = 5;
putDrive = 6;
putName = 7;
getDlgID = -4000;
getOpen = 1;
getCancel = 3;
getEject = 5;
getDrive = 6;
getNmList = 7;
getScroll = 8;
{ resource IDs and item offsets of 7.0 dialogs }
sfPutDialogID = -6043;
sfGetDialogID = -6042;
sfItemOpenButton = 1;
sfItemCancelButton = 2;
sfItemBalloonHelp = 3;
sfItemVolumeUser = 4;
sfItemEjectButton = 5;
sfItemDesktopButton = 6;
sfItemFileListUser = 7;
sfItemPopUpMenuUser = 8;
sfItemDividerLinePict = 9;
sfItemFileNameTextEdit = 10;
sfItemPromptStaticText = 11;
sfItemNewFolderUser = 12;
{ pseudo-item hits for use in DlgHook }
sfHookFirstCall = -1;
sfHookCharOffset = $1000;
sfHookNullEvent = 100;
sfHookRebuildList = 101;
sfHookFolderPopUp = 102;
sfHookOpenFolder = 103;
{ the following are only in system 7.0+ }
sfHookOpenAlias = 104;
sfHookGoToDesktop = 105;
sfHookGoToAliasTarget = 106;
sfHookGoToParent = 107;
sfHookGoToNextDrive = 108;
sfHookGoToPrevDrive = 109;
sfHookChangeSelection = 110;
sfHookSetActiveOffset = 200;
sfHookLastCall = -2;
{ the refcon field of the dialog record during a}
{ modalfilter or dialoghook contains one of the following }
sfMainDialogRefCon = 'stdf';
sfNewFolderDialogRefCon = 'nfdr';
sfReplaceDialogRefCon = 'rplc';
sfStatWarnDialogRefCon = 'stat';
sfLockWarnDialogRefCon = 'lock';
sfErrorDialogRefCon = 'err ';
type
SFReply = record
good: BOOLEAN;
copy: BOOLEAN;
fType: OSType;
vRefNum: INTEGER;
version: INTEGER;
fName: Str63;
end;
StandardFileReply = record
sfGood: BOOLEAN;
sfReplacing: BOOLEAN;
sfType: OSType;
sfFile: FSSpec;
sfScript: ScriptCode;
sfFlags: INTEGER;
sfIsFolder: BOOLEAN;
sfIsVolume: BOOLEAN;
sfReserved1: LONGINT;
sfReserved2: INTEGER;
end;
{ for CustomXXXFile, ActivationOrderListPtr parameter is a pointer to an array of item numbers }
ActivationOrderListPtr = ^INTEGER;
{ the following also include an extra parameter of "your data pointer" }
DlgHookProcPtr = ProcPtr; { FUNCTION DlgHook(item: INTEGER; theDialog: DialogPtr): INTEGER; }
FileFilterProcPtr = ProcPtr; { FUNCTION FileFilter(pb: CInfoPBPtr): BOOLEAN; }
DlgHookYDProcPtr = ProcPtr; { FUNCTION DlgHookYD(item: INTEGER; theDialog: DialogPtr; yourDataPtr: UNIV Ptr): INTEGER; }
ModalFilterYDProcPtr = ProcPtr; { FUNCTION ModalFilterYD(theDialog: DialogPtr; VAR theEvent: EventRecord; VAR itemHit: INTEGER; yourDataPtr: UNIV Ptr): BOOLEAN; }
FileFilterYDProcPtr = ProcPtr; { FUNCTION FileFilterYD(pb: CInfoPBPtr; yourDataPtr: UNIV Ptr): BOOLEAN; }
ActivateYDProcPtr = ProcPtr; { PROCEDURE ActivateYD(theDialog: DialogPtr; itemNo: INTEGER; activating: BOOLEAN; yourDataPtr: UNIV Ptr); }
DlgHookUPP = UniversalProcPtr;
FileFilterUPP = UniversalProcPtr;
DlgHookYDUPP = UniversalProcPtr;
ModalFilterYDUPP = UniversalProcPtr;
FileFilterYDUPP = UniversalProcPtr;
ActivateYDUPP = UniversalProcPtr;
const
uppDlgHookProcInfo = $000003A0; { FUNCTION (2 byte param, 4 byte param): 2 byte result; }
uppFileFilterProcInfo = $000000D0; { FUNCTION (4 byte param): 1 byte result; }
uppDlgHookYDProcInfo = $00000FA0; { FUNCTION (2 byte param, 4 byte param, 4 byte param): 2 byte result; }
uppModalFilterYDProcInfo = $00003FD0; { FUNCTION (4 byte param, 4 byte param, 4 byte param, 4 byte param): 1 byte result; }
uppFileFilterYDProcInfo = $000003D0; { FUNCTION (4 byte param, 4 byte param): 1 byte result; }
uppActivateYDProcInfo = $000036C0; { PROCEDURE (4 byte param, 2 byte param, 1 byte param, 4 byte param); }
function NewDlgHookProc (userRoutine: DlgHookProcPtr): DlgHookUPP;
{$IFC NOT GENERATINGCFM }
inline
$2E9F;
{$ENDC}
function NewFileFilterProc (userRoutine: FileFilterProcPtr): FileFilterUPP;
{$IFC NOT GENERATINGCFM }
inline
$2E9F;
{$ENDC}
function NewDlgHookYDProc (userRoutine: DlgHookYDProcPtr): DlgHookYDUPP;
{$IFC NOT GENERATINGCFM }
inline
$2E9F;
{$ENDC}
function NewModalFilterYDProc (userRoutine: ModalFilterYDProcPtr): ModalFilterYDUPP;
{$IFC NOT GENERATINGCFM }
inline
$2E9F;
{$ENDC}
function NewFileFilterYDProc (userRoutine: FileFilterYDProcPtr): FileFilterYDUPP;
{$IFC NOT GENERATINGCFM }
inline
$2E9F;
{$ENDC}
function NewActivateYDProc (userRoutine: ActivateYDProcPtr): ActivateYDUPP;
{$IFC NOT GENERATINGCFM }
inline
$2E9F;
{$ENDC}
function CallDlgHookProc (item: INTEGER; theDialog: DialogPtr; userRoutine: DlgHookUPP): INTEGER;
{$IFC NOT GENERATINGCFM}
inline
$205F, $4E90;
{$ENDC}
function CallFileFilterProc (pb: CInfoPBPtr; userRoutine: FileFilterUPP): BOOLEAN;
{$IFC NOT GENERATINGCFM}
inline
$205F, $4E90;
{$ENDC}
function CallDlgHookYDProc (item: INTEGER; theDialog: DialogPtr; yourDataPtr: univ Ptr; userRoutine: DlgHookYDUPP): INTEGER;
{$IFC NOT GENERATINGCFM}
inline
$205F, $4E90;
{$ENDC}
function CallModalFilterYDProc (theDialog: DialogPtr; var theEvent: EventRecord; var itemHit: INTEGER; yourDataPtr: univ Ptr; userRoutine: ModalFilterYDUPP): BOOLEAN;
{$IFC NOT GENERATINGCFM}
inline
$205F, $4E90;
{$ENDC}
function CallFileFilterYDProc (pb: CInfoPBPtr; yourDataPtr: univ Ptr; userRoutine: FileFilterYDUPP): BOOLEAN;
{$IFC NOT GENERATINGCFM}
inline
$205F, $4E90;
{$ENDC}
procedure CallActivateYDProc (theDialog: DialogPtr; itemNo: INTEGER; activating: BOOLEAN; yourDataPtr: univ Ptr; userRoutine: ActivateYDUPP);
{$IFC NOT GENERATINGCFM}
inline
$205F, $4E90;
{$ENDC}
type
SFTypeList = array[0..3] of OSType;
{}
{ The GetFile "typeList" parameter type has changed from "SFTypeList" to "ConstSFTypeListPtr".}
{ For C, this will add "const" and make it an in-only parameter.}
{ For Pascal, this will require client code to use the @ operator, but make it easier to specify long lists.}
{}
{ ConstSFTypeListPtr is a pointer to an array of OSTypes.}
{}
ConstSFTypeListPtr = ^OSType;
procedure SFPutFile (where: Point; prompt: ConstStr255Param; origName: ConstStr255Param; dlgHook: DlgHookUPP; var reply: SFReply);
{$IFC NOT GENERATINGCFM}
inline
$3F3C, $0001, $A9EA;
{$ENDC}
procedure SFGetFile (where: Point; prompt: ConstStr255Param; fileFilter: FileFilterUPP; numTypes: INTEGER; typeList: ConstSFTypeListPtr; dlgHook: DlgHookUPP; var reply: SFReply);
{$IFC NOT GENERATINGCFM}
inline
$3F3C, $0002, $A9EA;
{$ENDC}
procedure SFPPutFile (where: Point; prompt: ConstStr255Param; origName: ConstStr255Param; dlgHook: DlgHookUPP; var reply: SFReply; dlgID: INTEGER; filterProc: ModalFilterUPP);
{$IFC NOT GENERATINGCFM}
inline
$3F3C, $0003, $A9EA;
{$ENDC}
procedure SFPGetFile (where: Point; prompt: ConstStr255Param; fileFilter: FileFilterUPP; numTypes: INTEGER; typeList: ConstSFTypeListPtr; dlgHook: DlgHookUPP; var reply: SFReply; dlgID: INTEGER; filterProc: ModalFilterUPP);
{$IFC NOT GENERATINGCFM}
inline
$3F3C, $0004, $A9EA;
{$ENDC}
procedure StandardPutFile (prompt: ConstStr255Param; defaultName: ConstStr255Param; var reply: StandardFileReply);
{$IFC NOT GENERATINGCFM}
inline
$3F3C, $0005, $A9EA;
{$ENDC}
procedure StandardGetFile (fileFilter: FileFilterUPP; numTypes: INTEGER; typeList: ConstSFTypeListPtr; var reply: StandardFileReply);
{$IFC NOT GENERATINGCFM}
inline
$3F3C, $0006, $A9EA;
{$ENDC}
procedure CustomPutFile (prompt: ConstStr255Param; defaultName: ConstStr255Param; var reply: StandardFileReply; dlgID: INTEGER; where: Point; dlgHook: DlgHookYDUPP; filterProc: ModalFilterYDUPP; activeList: ActivationOrderListPtr; activate: ActivateYDUPP; yourDataPtr: univ Ptr);
{$IFC NOT GENERATINGCFM}
inline
$3F3C, $0007, $A9EA;
{$ENDC}
procedure CustomGetFile (fileFilter: FileFilterYDUPP; numTypes: INTEGER; typeList: ConstSFTypeListPtr; var reply: StandardFileReply; dlgID: INTEGER; where: Point; dlgHook: DlgHookYDUPP; filterProc: ModalFilterYDUPP; activeList: ActivationOrderListPtr; activate: ActivateYDUPP; yourDataPtr: univ Ptr);
{$IFC NOT GENERATINGCFM}
inline
$3F3C, $0008, $A9EA;
{$ENDC}
function StandardOpenDialog (var reply: StandardFileReply): OSErr;
{ $ALIGN RESET}
{ $POP}
{$ENDC}
{__STANDARDFILE__}
implementation
end.